<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>修改密码</title>

		<link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
		<link href="../AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

		<link href="../css/personal.css" rel="stylesheet" type="text/css">
		<link href="../css/stepstyle.css" rel="stylesheet" type="text/css">

		<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
		<script src="../AmazeUI-2.4.2/assets/js/amazeui.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.6/vue.min.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.min.js"></script>
		<script src="../js/axiosUtil.js"></script>
		<script src="../js/public.js"></script>
	</head>

	<body>
		<!--头 -->
		<header>
			<article>
				<div class="mt-logo" id="app1">
					<!--顶部导航条 -->
					<div class="am-container header">
						<ul class="message-l">
							<div class="topMessage">
								<template v-if="!islogin">
									<div class="menu-hd">
										<a href="login.html" target="_top" class="h">亲，请登录</a>
										<a href="register.html" target="_top">免费注册</a>
									</div>
								</template>
								<template v-else>
									<div class="menu-hd">
										<a href="#" style="color: red;">{{username}}</a>
										<a href="#" @click="logout">退出登录</a>
									</div>
								</template>
							</div>
						</ul>
						<ul class="message-r" v-if="islogin">
							<div class="topMessage home">
								<div class="menu-hd"><a href="home.html" target="_top" class="h">商城首页</a></div>
							</div>
							<template v-if="islogin">
								<div class="topMessage my-shangcheng">
									<div class="menu-hd MyShangcheng"><a href="information.html" target="_top"><i
												class="am-icon-user am-icon-fw"></i>个人中心</a></div>
								</div>
								<div class="topMessage mini-cart">
									<div class="menu-hd"><a id="mc-menu-hd" href="shopcart.html" target="_top"><i
												class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong
												id="J_MiniCartNum" class="h">0</strong></a></div>
								</div>
							</template>
						</ul>
					</div>

						<!--悬浮搜索框-->

						<div class="nav white">
							<div class="logoBig">
								<li><img src="../images/logobig.png" /></li>
							</div>

							<div class="search-bar pr">
								<a name="index_none_header_sysc" href="#"></a>
								<form>
									<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
									<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
								</form>
							</div>
						</div>

						<div class="clear"></div>
					</div>
				</div>
			</article>
		</header>
            <div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="#">首页</a></li>
                                <li class="qc"><a href="#">闪购</a></li>
                                <li class="qc"><a href="#">限时抢</a></li>
                                <li class="qc"><a href="#">团购</a></li>
                                <li class="qc last"><a href="#">大包装</a></li>
							</ul>
						</div>
			</div>
			<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="am-cf am-padding">
						<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">修改密码</strong> / <small>Password</small></div>
					</div>
					<hr/>
					<!--进度条-->
					<div class="m-progress">
						<div class="m-progress-list">
							<span class="step-1 step">
                                <em class="u-progress-stage-bg"></em>
                                <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                <p class="stage-name">重置密码</p>
                            </span>
							<span class="step-2 step">
                                <em class="u-progress-stage-bg"></em>
                                <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                <p class="stage-name">完成</p>
                            </span>
							<span class="u-progress-placeholder"></span>
						</div>
						<div class="u-progress-bar total-steps-2">
							<div class="u-progress-bar-inner"></div>
						</div>
					</div>
					<div id="app2">
						<form class="am-form am-form-horizontal">
							<div class="am-form-group">
								<label for="user-old-password" class="am-form-label">原密码</label>
								<div class="am-form-content">
									<input type="password" id="user-old-password" placeholder="请输入原登录密码" v-model="user.oldPwd">
								</div>
							</div>
							<div class="am-form-group">
								<label for="user-new-password" class="am-form-label">新密码</label>
								<div class="am-form-content">
									<input type="password" id="user-new-password" placeholder="由数字、字母组合" v-model="user.newPwd">
								</div>
							</div>
							<div class="am-form-group">
								<label for="user-confirm-password" class="am-form-label">确认密码</label>
								<div class="am-form-content">
									<input type="password" id="user-confirm-password" placeholder="请再次输入上面的密码" v-model="newPwd2">
								</div>
							</div>
							<div class="info-btn">
								<div class="am-btn am-btn-danger" @click="update">保存修改</div>
							</div>
						</form>
					</div>
				</div>
				<!--底部-->
				<div class="footer">
					<div class="footer-hd ">
						<p>
							<a href="# ">燕园科技</a>
							<b>|</b>
							<a href="home.html">商城首页</a>
							<b>|</b>
							<a href="# ">支付宝</a>
							<b>|</b>
							<a href="# ">物流</a>
						</p>
					</div>
					<div class="footer-bd ">
						<p>
							<a href="#">关于燕园</a>
							<a href="# ">合作伙伴</a>
							<a href="# ">联系我们</a>
							<a href="# ">网站地图</a>
						</p>
					</div>
				</div>
			</div>

			<aside class="menu">
				<ul>
					<li class="person">
						<a href="#">个人中心</a>
					</li>
					<li class="person">
						<a href="#">个人资料</a>
						<ul>
							<li > <a href="information.html">个人信息</a></li>
							<li> <a href="address.html">收货地址</a></li>
							<li class="active"> <a href="#">修改密码</a></li>
						</ul>
					</li>
					<li class="person">
						<a href="#">我的交易</a>
						<ul>
							<!-- <li><a href="order.html">订单管理</a></li> -->
							<li> <a href="billlist.html">账单明细</a></li>
						</ul>
					</li>
	
				</ul>
			</aside>
		</div>
		<script>
			let vm2 = new Vue({
			  el: '#app2',
			  data: {
				  user: {
					oldPwd: '',
					newPwd: ''
				  },
				  newPwd2: ''
			  },
			  methods: {
				update() {
					if (this.user.newPwd === this.newPwd2 && this.newPwd2.length>4){
						$axios.put('/user/updatePwd',response => {window.alert("修改密码成功")},this.user)
					} else {
						window.alert("输入不符合要求")
					}
					
				}
			  }
			})
		  </script>
	</body>

</html>